public class PC extends Object{
	CPU cpu;
	HardDisk HD;
	PC() {}
	PC(CPU cpu) {
		this.cpu = cpu;
	}
	PC(HardDisk HD) {
		this.HD = HD;
	}
	PC(CPU cpu,HardDisk HD) {
		this.cpu = cpu;
		this.HD = HD;
	}
	public void setCPU(CPU a) {
		cpu = a;
	}
	public void setHardDisk(HardDisk b) {
		HD = b;
	}
	public void show() {
		System.out.printf("The speed of CPU is: %d \n",cpu.getSpeed());
		System.out.printf("The Amount of HD is: %d \n",HD.getAmount());
	}
	public String toString() {
		return "PC已覆盖toString";
	}
	public boolean equals(Object obj) {
		PC vpc = new PC();
		vpc = (PC)obj;
		if(vpc.cpu == this.cpu&&vpc.HD == this.HD){
			return true;
		}
		else {
			return false;
		}
	}
}

